d_obj = {"name":"suki","age":19,"address":"辽宁沈阳"}
# ================================新增======================================
# 根据不存在的字典key可以新增
# d_obj['phone'] = "159897222"

# 查看下字典内容
# print(d_obj)

# 使用内置方法新增
"""
d_obj.update({"sex":"女","email":"123@163.com"})
print(d_obj)
"""
# ================================修改======================================
# 可以直接通过key进行修改
# d_obj['name'] = '张三'
# print(d_obj)

#===============================删除======================================
# 可以内置方法进行删除
# d_obj.pop('name')
# print(d_obj)

# 可以使用python的内置方法进行删除
# del d_obj['age']
# print(d_obj)

# ======================字典遍历===========================
# 遍历key
d_obj1 = {"name":"suki","age":19,"address":"辽宁沈阳"}
for key in d_obj1:
    """
    name
    age
    address
    """
    print(key)
# 内容同上
for key in d_obj1.keys():
    print(key)

# 遍历value
for value in d_obj1.values():
    """
    suki
    19
    辽宁沈阳
    """
    print(value)

# 遍历键值对
for key,value in d_obj1.items():
    print(key,value)

